//
//  NavigationViewController.m
//  Ezi2u
//
//  Created by mac on 16/10/14.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "NavigationViewController.h"
#import <SVProgressHUD.h>

@implementation NavigationViewController

- (IBAction)closeWebView:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

-(void)navigateWithUrl:(NSString *)url{
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
    [self.mainWebView loadRequest:request];
    [SVProgressHUD showWithStatus:@"Loading..."];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    
}
#pragma mark -UIWebViewDelegate-
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    NSURL *url = [request URL];
    NSLog(@"navigate_url==>%@",url);
    if ([[url scheme] isEqualToString:@"submit_app"]) {
        
    }
    return YES;
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
    NSLog(@"webViewDidStartLoad!");
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    NSLog(@"webViewDidFinishLoad!");
    [SVProgressHUD dismiss];
}

@end
